/*
Building a Clean and Loyal State: The Strategic Dilemma of an Anti-corruption Campaign Under One-Party Rule
Authors: Tianyang Xi, Yang Yao and Qian Zhang
Date: Oct, 30, 2023
Stata Version 14.0
Operating System: Micrsoft Windows 10
*/

clear
set more off
capture log close

*-------------------------------Figure 3------------------------------------*
use "baiduindex.dta" ,clear

*generate year data
gen year=int(yr_month/100)
bysort id year: egen index=mean(mean_index)
duplicates drop id year, force

set scheme lean1

*graph Figure 3(a)
line index year if id==15, xlabel(2006(1)2022, labsize(*0.8)) ytitle(Baidu Index) xtitle(year)

*graph Figure 3(b)
line index year if id==1, xlabel(2006(1)2022, labsize(*0.8)) ytitle(Baidu Index) xtitle(year)

*graph Figure 3(c)
line index year if id==12, xlabel(2006(1)2022, labsize(*0.8)) ytitle(Baidu Index) xtitle(year)

*graph Figure 3(d)
line index year if id==14, xlabel(2006(1)2022, labsize(*0.8)) ytitle(Baidu Index) xtitle(year)
